#!/bin/bash

USER=${1}
HOST=${2}
PORT=${3}

if [[ $* =~ '-s'  ]]; then

  FTP_PATH=`echo "$*" | sed 's/.*-s/-s/g' | awk -F ' ' '{print $2}'`

  sftp -P ${PORT} ${USER}@${HOST}:${FTP_PATH}
  # lftp -p ${PORT} ${USER}@${HOST}:${FTP_PATH}

else

  ssh -p ${PORT} ${USER}@${HOST}

fi